package test.java.com.project;

import java.util.Random;
import java.util.UUID;

public class RandomDemo {
    public static void main(String[] args){
        int theRandomNum=(int)(Math.random()*100);
        System.out.println(theRandomNum);

        //唯一标识符。比如做商品标识
        UUID uuid=UUID.randomUUID();
        System.out.println("这个uuid是"+uuid.toString());

        //生成随机的整数
        Random rand=new Random();
        System.out.println(rand.nextInt());
        System.out.println(rand.nextFloat());
        System.out.println(Math.PI);
    }
}
